package cc.yiueil.vo;

import lombok.Data;

@Data
public class ResultVo<T> {
    private int code;
    private String message;
    private T data;

    public ResultVo(int code, String message, T data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    // 可以添加一些静态方法来快速创建实例，例如：
    public static <T> ResultVo<T> success(T data) {
        return new ResultVo<>(200, "success", data);
    }

    public static <T> ResultVo<T> error(int code, String message) {
        return new ResultVo<>(code, message, null);
    }
}
